-- title:  Music Demo
-- author: Tromino
-- desc:   music made with custom waveforms
-- script: lua
-- input:  gamepad

t=0
x=104
y=24

function TIC()

	if btnp()~=0 then music(0) end

	cls(12)
	spr(1+(t%60)/30,x,y,-1,4)
	print("PRESS START TO RICH!",44,64)
	t=t+1
end

-- <TILES>
-- 001:0066600006066660ddddd666f0f0fff0fdfdff0f0ff00ffff0066ff00f66f000
-- 002:8811188881811118ccccc111f8f8fff8fcfcff8f8ff88ffff8811ff88f11f888
-- </TILES>

-- <WAVES>
-- 000:17afadcf936f05789abc868ddc975310
-- 001:49dece9dcb9789bccccba89aaaa98641
-- 002:69abb9bbcccbba9cddcca989abaaa863
-- 003:6799abbbba98767789987abccca98887
-- 004:789abcbbaa9987777889aaaaaa998766
-- 005:789abbbbbbaa9988888888999aaa9998
-- 006:7888999aaaaaaaaa9999888999988887
-- 007:77777788889999999999999988888777
-- 008:9cdeeffffeddcb986432110111123457
-- 009:abdeffffeedcba976543322111112256
-- 010:8bdefffedccbbaa99887654321100147
-- 011:8aceffedcbaa98888998877654221125
-- 012:8bdeffeb976678899987766543211125
-- 013:bdeeb8766667889aaaaa998877653347
-- 014:01236deffffffffffffffeed64345420
-- </WAVES>

-- <SFX>
-- 000:000001000200030004000500060007000700070007000700070007000700070007000700070007000700070007000700070007000700070007000700309000000000
-- 001:800081008200830084008500860087008700870087008700870087008700870087008700870087008700870087008700870087008700870087008700300000000000
-- 002:40004000400040004100410041004100420042004200420043004300430043004400440044004400450045004500450046004600460046004700470010b000000000
-- 003:08000800090009000a000a000b000b000c000c000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d000d0030b000000000
-- 004:880f880f890f890f8a0f8a0f8b0f8b0f8c0f8c0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f8d0f30b000000000
-- 005:050e030102030104010602070207030704060506070509050b040c040c030d030d030d020c020b0209030803180317032604260435045504a405f405a09000000000
-- 006:2f022e2f3e1f5f977fa79fb7afb7bfc7cfc7dfd7dfd7efe7efe7efe7eff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7fff7c00000000000
-- </SFX>

-- <PATTERNS>
-- 000:8ff1069ff116bff1068ff116fff106bff1166ff108fff1168ff1086ff1186ff1088ff118fff1066ff118bff106fff1168ff106bff116bff1068ff116fff106bff1166ff108fff1168ff1086ff1186ff1088ff118fff1066ff118bff106fff1166ff106bff1169ff1066ff116dff1069ff1164ff108dff1166ff1084ff1184ff1086ff118dff1064ff1189ff106dff1166ff1069ff1169ff1066ff116dff1069ff1164ff108dff1166ff1084ff1184ff1086ff118dff1064ff1189ff106dff116
-- 001:8ff1240000008ff1240000004ff1680000008ff1240000000000000000008ff1240000004ff1680000008ff1240000008ff1240000008ff1240000004ff1680000008ff1240000000000000000008ff1240000004ff1680000008ff1240000006ff1240000006ff1240000004ff1680000006ff1240000000000000000006ff1240000004ff1680000006ff1240000006ff1240000006ff1240000004ff1680000006ff1240000000000000000006ff1240000004ff1680000006ff124000000
-- 002:8ff1380000000000000000000000000000000000000000006ff1380000000000000000000000000000000000000000008ff138000000000000000000fff138000000000000000000000000000000000000000000bff1380000000000000000009ff1380000000000000000000000000000000000000000006ff1380000000000000000000000000000000000000000009ff138000000000000000000dff138000000000000000000000000000000000000000000bff138000000000000000000
-- 003:0000000000000000008ff1480000000000000000000000000000000000000000006ff1480000000000000000000000000000000000000000008ff148000000000000000000fff148000000000000000000000000000000000000000000bff1480000000000000000009ff1480000000000000000000000000000000000000000006ff1480000000000000000000000000000000000000000009ff148000000000000000000dff148000000000000000000000000000000000000000000bff148
-- </PATTERNS>

-- <TRACKS>
-- 000:1800001800001803011803010000000000000000000000000000000000000000000000000000000000000000000000000000ff
-- </TRACKS>

-- <PALETTE>
-- 000:140c1c44243430346d4e4a4e854c30346524d04648757161597dced27d2c8595a16daa2cd2aa996dc2cadad45edeeed6
-- </PALETTE>

